<?php /* Smarty version 2.6.26, created on 2018-07-25 15:57:13
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/admin%5Ctemplates/category_attr/edit.html */ ?>
<table class="etable"> 
	<tr>
		<td width="80">所属分类</td>
		<td><div class="cats_list"></div></td>
		<input type="hidden" name="cid" value="<?php echo $this->_tpl_vars['row']['cid']; ?>
" id="cid"/> 
	</tr> 
	<tr>
		<td>属性名</td>
		<td><input name="name" type="text" size="32" id="name" value="<?php echo $this->_tpl_vars['row']['name']; ?>
" placeholder="必填"/><i>必填</i>
			<p>批量添加需要逗号分开</p>
		</td>
	</tr>
	<tr>
		<td>排序</td>
		<td><input name="px" type="text" size="12" id="px" value="<?php echo $this->_tpl_vars['row']['px']; ?>
"/></td>
	</tr> 
</table> 
<script type="text/javascript"> 
<?php if ($this->_tpl_vars['row']['cid']): ?>
	category_list('<?php echo $this->_tpl_vars['row']['cid']; ?>
');	
<?php else: ?>
	category_next('0');	
<?php endif; ?>
function ajax_submit(){
	var cid = $("#cid").val(); 
	var name = $("#name").val();
	var px = $("#px").val();
	$.post('?m=category_attr&a=save',{<?php if ($this->_tpl_vars['row']['id']): ?>id:<?php echo $this->_tpl_vars['row']['id']; ?>
,<?php endif; ?> cid:cid, name:name, px:px},function(result){ 
		data = jQuery.parseJSON(result); 
		if(data.error == '0'){
			parent.ajax_flush();
			parent.ajax_close();
		}else{
			parent.$.alert(data.msg);
		} 
	});
}
</script>